<?php
//include("ini.php");
@session_start();
session_cache_expire( 60 );
$inactive = $_SESSION['inactive'] = 3600;//INACTIVE;
if(isset($_SESSION['start'])){
	$session_life = time() - $_SESSION['start'];
	if($session_life > $inactive){
		unset($_SESSION['islogued']);
		$_SESSION["error"] = "El tiempo de inactividad ha caducado.<br>Vuelva a iniciar por favor.";
		header("Location:../index.php");
	}
}
$_SESSION['start'] = time();
if(!isset($_SESSION["usuario"])){
	header("location:../index.php"); /* Si no ha iniciado la sesion, va a index.php */
} else {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>..::SGMEC::..</title>
	<meta charset="utf-8">
	<meta name="author" content="cg">
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<link rel="stylesheet" href="../css/blueprint/screen.css" type="text/css" media="screen, projection">
	<link rel="stylesheet" href="../css/blueprint/print.css" type="text/css" media="print" />
	<link rel="stylesheet" href="../css/blueprint/ie.css" type="text/css" media="screen" />
	<link rel="stylesheet" href="../css/style.css" type="text/css" media="all" />
	<link rel="shortcut icon" href="../images/sgmec2.jpg" />
	<link rel="stylesheet" type="text/css" href="../menu/style/menu_style.css">
	<link rel="stylesheet" type="text/css" href="../menu/style/nav-h.css">
</head>

<!-- <body class="img_body">-->
<body background="../images/fondo/fondo44.jpg">
<?php include("../menu/menuprincipal.php"); ?>
<div class="container showgrid3"><!--Contenedor Principal-->

	<div class="span-24 last"><!--usuario-->
		<table width="100%" border="0">
			<tr>
				<td id="sesion" width="100%" align="right" style='font-size:12px;'><?php setlocale(LC_TIME, 'es_ES.UTF-8'); echo utf8_encode(strftime("%d/%m/%Y" ,time()));/*%I:%M%p*/?>&nbsp;&nbsp;|&nbsp;&nbsp;Usuario: <strong><?php echo strtoupper($_SESSION['usuario']);?></strong>

&nbsp;&nbsp;|&nbsp;&nbsp;<b><a href="inicio.php">Inicio</b><img src="../images/home.png" height="16" width="16"></a>

&nbsp;&nbsp;|&nbsp;&nbsp;<b><a href="logout.php">Cerrar Sesi&oacute;n</b><img src="../images/logout.png" height="16" width="16"></a></td>
			</tr>
		</table>
	</div>

	<div class="span-24 last"><!--Menu-->
		<div>
		<table width="100%" border="0" bgcolor="#116">
			<tr>
			<td><?php funcionmenu($_SESSION['perfil']); ?></td>
			</tr>
        </table>
		</div>
	</div>

	<div class="span-24 last"><!--CUERPO-->
		<div>
			<iframe name="sgmec" src="./inicio.html" frameborder="0" width="100%" height="800"></iframe>
		</div>
	</div>

	<div class="span-24 last"><!--Footer-->	
		<div class="img_footer"></div>
    </div>

</div>
</body>
</html>
<?php
} /* Cerramos el else */ 
?>
